<template>
    <view>
        <view class="top">
            <image class="image" :src="tup" mode=""></image>
        </view>
        <view v-if="cgsb == 1" class="shim">实名认证成功</view>
        <view v-if="cgsb == 2" class="shim">恭喜您，提现认证已通过！</view>
        <view v-if="cgsb == 3" class="shim">实名认证失败</view>
        <view class="shir">app端请点击左上角返回</view>
        <view class="btn" @click="btnn">返回</view>
    </view>
</template>
<script>
import wx from 'weixin-js-sdk';
export default {
    data() {
        return {
            tup: '',
            cgsb: 1
        };
    },
    onLoad() {
        var that = this;
        let uuid = this.$route.query.uuid;
        let result = this.$route.query.result;
        uni.request({
            url: that.app.apiHost + `/faceResult?uuid=${uuid}&result=${result}`,
            method: 'GET',
            header: {},
            success: (res) => {
                console.log(222, res);
                if (res.data.code == '0') {
                    // 失败
                    this.cgsb = 3;
                    this.tup = that.app.httpUrl + '/static/uniapp/img/face_error.png';
                } else {
                    if (res.data.authType == 2) {
                        this.cgsb = 2;
                    } else {
                        this.cgsb = 1;
                    }
                    // 成功
                    this.tup = that.app.httpUrl + '/static/uniapp/img/face_success.png';
                }
            },
            fail(res) {}
        });
    },
    methods: {
        btnn() {
            wx.miniProgram.switchTab({
                url: '/pages/index/index'
            });
        }
    }
};
</script>

<style scoped lang="scss">
.btn {
    width: 688rpx;
    height: 77rpx;
    background-color: #383843;
    border-radius: 38rpx;
    text-align: center;
    line-height: 77rpx;
    font-size: 30.77rpx;
    color: #fff;
    margin: 107rpx auto;
}
.shim {
    text-align: center;
    color: #333333;
    font-size: 40.38rpx;
    margin-bottom: 23.08rpx;
}
.shir {
    text-align: center;
    color: #333333;
    font-size: 26.92rpx;
    margin-bottom: 107.69rpx;
}
.top {
    display: flex;
    height: 307rpx;
    width: 211.54rpx;
    height: 211.54rpx;
    margin: 36.54rpx auto;
    align-items: center;
    justify-content: center;
    margin-bottom: 30.77rpx;
    .image {
        width: 211.54rpx;
        height: 211.54rpx;
    }
}
</style>
